﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Reporte.aspx.cs" Inherits="NMT_WEB.Frm.Reporte"
    MaintainScrollPositionOnPostback="true" %>

<%@ Register TagPrefix="menu" TagName="menuTop" Src="../UserControls/Menu.ascx" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>NMT - Consulta de Reportes</title>
</head>
<body>
    <form id="form1" runat="server">
    <table id="Table1" cellspacing="0" cellpadding="0" width="980px" border="0" class="table"
        runat="server">
        <tr>
            <td>
                <menu:menuTop ID="Menu" runat="server" />
            </td>
        </tr>
        <tr>
            <td style="height: 25px">
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:Label ID="lblTitulo" runat="server" CssClass="labeltitulo" Width="100%">Consulta de Reportes</asp:Label>
                <asp:ScriptManager ID="AJAX" runat="server" EnablePartialRendering="True">
                </asp:ScriptManager>
            </td>
        </tr>
        <tr>
            <td style="height: 15px">
            </td>
        </tr>
        <tr>
            <td>
                <asp:UpdatePanel ID="UdPanel1" runat="server">
                    <ContentTemplate>
                        <asp:ValidationSummary ID="Errors" runat="server" CssClass="error" HeaderText="Validaciones" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td style="height: 5px">
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                    <ContentTemplate>
                        <table id="Table3" cellspacing="0" cellpadding="0" border="1">
                            <tr>
                                <td>
                                    <table id="Table2" cellspacing="0" cellpadding="0" width="570px" border="0">
                                        <tr>
                                            <td colspan="4">
                                                <p style="text-align: left;">
                                                    &nbsp;&nbsp;<asp:Label ID="Label1" runat="server" Font-Underline="true" Text="Filtros"
                                                        CssClass="label2"></asp:Label>
                                                    &nbsp;&nbsp;&nbsp;<asp:Label ID="Label13" runat="server" Text="(*) - Filtros Requeridos"
                                                        CssClass="error2"></asp:Label>
                                                </p>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="height: 30px;">
                                                &nbsp;&nbsp;&nbsp;
                                                <asp:Label ID="LblUsuario" runat="server" Text="Usuario :" CssClass="label"></asp:Label>
                                                &nbsp;&nbsp;&nbsp;
                                            </td>
                                            <td align="left" colspan="3">
                                                <asp:TextBox ID="txtUsuario" runat="server" CssClass="textbox" MaxLength="250" Width="248px"
                                                    Height="16px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="height: 30px;">
                                                &nbsp;&nbsp;&nbsp;
                                                <asp:Label ID="Label3" runat="server" Text="Fecha de :" CssClass="label"></asp:Label>
                                                <asp:Label ID="Label12" runat="server" Text="*" CssClass="error"></asp:Label>
                                                &nbsp;&nbsp;&nbsp;
                                            </td>
                                            <td align="left" colspan="3">
                                                <ew:CalendarPopup ID="txtFechaDe" TabIndex="31" runat="server" Width="68px" ImageUrl="../App_Themes/Imagenes/Calendario.gif"
                                                    ControlDisplay="TextBoxImage" GoToTodayText="Hoy:" ClearDateText="Borrar Fecha"
                                                    Nullable="true" NullableLabelText=" " DayNameFormat="FirstTwoLetters" MonthYearApplyText="Aceptar"
                                                    MonthYearCancelText="Cancelar" ShowClearDate="true" Culture="Spanish (Mexico)"
                                                    PopupLocation="Right" Text="Ingresar Fecha">
                                                    <TextBoxLabelStyle CssClass="textbox"></TextBoxLabelStyle>
                                                    <WeekdayStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"
                                                        BackColor="White"></WeekdayStyle>
                                                    <MonthHeaderStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="LightBlue"></MonthHeaderStyle>
                                                    <OffMonthStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="White"
                                                        BackColor="White"></OffMonthStyle>
                                                    <GoToTodayStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="White"></GoToTodayStyle>
                                                    <TodayDayStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"
                                                        BackColor="LightSteelBlue"></TodayDayStyle>
                                                    <DayHeaderStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="SteelBlue"></DayHeaderStyle>
                                                    <WeekendStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"
                                                        BackColor="LightGray"></WeekendStyle>
                                                    <SelectedDateStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="DarkGray"></SelectedDateStyle>
                                                    <ClearDateStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="White"></ClearDateStyle>
                                                </ew:CalendarPopup>
                                                <ew:RequiredFieldValidator ID="rfvValidador1" runat="server" ControlToValidate="txtFechaDe"
                                                    EnableClientScript="true" ErrorMessage="'Fecha De' - Requerida" Font-Size="Small"
                                                    InitialValue="" SetFocusOnError="true" CssClass="error">&nbsp;</ew:RequiredFieldValidator>
                                                &nbsp;
                                                <asp:Label ID="Label4" runat="server" Text="a :" CssClass="label"></asp:Label>
                                                <asp:Label ID="Label11" runat="server" Text="*" CssClass="error"></asp:Label>
                                                &nbsp;&nbsp;
                                                <ew:CalendarPopup ID="txtFechaA" TabIndex="31" runat="server" Width="68px" ImageUrl="../App_Themes/Imagenes/Calendario.gif"
                                                    ControlDisplay="TextBoxImage" GoToTodayText="Hoy:" ClearDateText="Borrar Fecha"
                                                    Nullable="true" NullableLabelText=" " DayNameFormat="FirstTwoLetters" MonthYearApplyText="Aceptar"
                                                    MonthYearCancelText="Cancelar" ShowClearDate="true" Culture="Spanish (Mexico)"
                                                    PopupLocation="Bottom" Text="Ingresar Fecha">
                                                    <TextBoxLabelStyle CssClass="textbox"></TextBoxLabelStyle>
                                                    <WeekdayStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"
                                                        BackColor="White"></WeekdayStyle>
                                                    <MonthHeaderStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="LightBlue"></MonthHeaderStyle>
                                                    <OffMonthStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="White"
                                                        BackColor="White"></OffMonthStyle>
                                                    <GoToTodayStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="White"></GoToTodayStyle>
                                                    <TodayDayStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"
                                                        BackColor="LightSteelBlue"></TodayDayStyle>
                                                    <DayHeaderStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="SteelBlue"></DayHeaderStyle>
                                                    <WeekendStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial" ForeColor="Black"
                                                        BackColor="LightGray"></WeekendStyle>
                                                    <SelectedDateStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="DarkGray"></SelectedDateStyle>
                                                    <ClearDateStyle Font-Size="XX-Small" Font-Names="Verdana,Helvetica,Tahoma,Arial"
                                                        ForeColor="Black" BackColor="White"></ClearDateStyle>
                                                </ew:CalendarPopup>
                                                <ew:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtFechaA"
                                                    EnableClientScript="true" ErrorMessage="'Fecha A' - Requerida" Font-Size="Small"
                                                    InitialValue="" SetFocusOnError="true" CssClass="error">&nbsp;</ew:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="height: 110px;">
                                                &nbsp;&nbsp;&nbsp;
                                                <asp:Label ID="Label2" runat="server" Text="KPI :" CssClass="label"></asp:Label>
                                                <asp:Label ID="Label8" runat="server" Text="*" CssClass="error"></asp:Label>
                                                &nbsp;&nbsp;&nbsp;
                                            </td>
                                            <td align="left" colspan="3">
                                                <div id="div-listKPIs">
                                                    <asp:CheckBoxList ID="ChkKPIs" runat="server" CssClass="listaCheckBox" Width="330px"
                                                        AutoPostBack="True" OnSelectedIndexChanged="ChkKPIs_SelectedIndexChanged">
                                                    </asp:CheckBoxList>
                                                    <asp:HiddenField ID="HiddenIDsKPIs" runat="server" />
                                                </div>
                                                &nbsp;<asp:CheckBox ID="chkAllKPIs" runat="server" Text="Todos los KPIs" CssClass="labelAll"
                                                    AutoPostBack="True" OnCheckedChanged="chkAllKPIs_CheckedChanged" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="height: 110px;">
                                                &nbsp;&nbsp;&nbsp;
                                                <asp:Label ID="Label5" runat="server" Text="Zona :" CssClass="label"></asp:Label>
                                                <asp:Label ID="Label9" runat="server" Text="*" CssClass="error"></asp:Label>
                                                &nbsp;&nbsp;&nbsp;
                                            </td>
                                            <td align="left">
                                                <div id="div-listZona">
                                                    <asp:CheckBoxList ID="ChkZonas" runat="server" CssClass="listaCheckBox" Width="150px"
                                                        AutoPostBack="True" OnSelectedIndexChanged="ChkZonas_SelectedIndexChanged">
                                                    </asp:CheckBoxList>
                                                    <asp:HiddenField ID="HiddenIDsZonas" runat="server" />
                                                </div>
                                                &nbsp;<asp:CheckBox ID="ChkAllZonas" runat="server" Text="Todas las Zonas" CssClass="labelAll"
                                                    AutoPostBack="True" OnCheckedChanged="ChkAllZonas_CheckedChanged" />
                                            </td>
                                            <td align="right">
                                                &nbsp;&nbsp;&nbsp;
                                                <asp:Label ID="Label6" runat="server" Text="Territorio :" CssClass="label"></asp:Label>
                                                <asp:Label ID="Label10" runat="server" Text="*" CssClass="error"></asp:Label>
                                                &nbsp;&nbsp;&nbsp;
                                            </td>
                                            <td align="left">
                                                <div id="div-listTerritorio">
                                                    <asp:CheckBoxList ID="ChkTerritorios" runat="server" CssClass="listaCheckBox" Width="150px"
                                                        AutoPostBack="True" OnSelectedIndexChanged="ChkTerritorios_SelectedIndexChanged">
                                                    </asp:CheckBoxList>
                                                    <asp:HiddenField ID="HiddenIDsTerritorios" runat="server" />
                                                </div>
                                                &nbsp;<asp:CheckBox ID="ChkAllTerritorios" runat="server" Text="Todos los Territorios"
                                                    CssClass="labelAll" AutoPostBack="True" OnCheckedChanged="ChkAllTerritorios_CheckedChanged" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="4" style="height: 50px;">
                                                <asp:Button ID="BtnSearch" runat="server" Text="Generar" CssClass="button" TabIndex="1"
                                                    OnClick="BtnSearch_Click1" />
                                                <asp:HiddenField ID="HiddenFechaDe" runat="server" />
                                                <asp:HiddenField ID="HiddenFechaA" runat="server" />
                                                <asp:HiddenField ID="HiddenUsuario" runat="server" />
                                                <!-- Para pruebas. Comprobar los valores -->
                                                <asp:Label ID="lblTxtKPI" runat="server" Text="" Visible="False"></asp:Label>
                                                <asp:Label ID="lblTxtZona" runat="server" Text="" Visible="False"></asp:Label>
                                                <asp:Label ID="lblTxtTerritorio" runat="server" Text="" Visible="False"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr align="center">
            <td>
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0" AssociatedUpdatePanelID="UpdatePanel3">
                    <ProgressTemplate>
                        <img src="../App_Themes/Imagenes/Indicador.gif" alt="" />
                        &nbsp;<asp:Label ID="lblCargando" runat="server" CssClass="labelcarga">Cargando...</asp:Label>
                    </ProgressTemplate>
                </asp:UpdateProgress>
                <cc2:UpdateProgressOverlayExtender ID="Progreso" runat="server" ControlToOverlayID="Table1"
                    CssClass="updateProgress" TargetControlID="UpdateProgress1" />
                <asp:UpdateProgress ID="UpdateProgress2" runat="server" DisplayAfter="0" AssociatedUpdatePanelID="UdPanel2">
                    <ProgressTemplate>
                        <div>
                            <img src="../App_Themes/Imagenes/Indicador.gif" alt="" />
                            &nbsp;<asp:Label ID="lblCargando2" runat="server" CssClass="labelcarga">Generando...</asp:Label>
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
                <cc2:UpdateProgressOverlayExtender ID="UpdateProgressOverlayExtender1" runat="server"
                    CssClass="updateProgress" TargetControlID="UpdateProgress2" ControlToOverlayID="ReportViewer1" />
            </td>
        </tr>
        <tr>
            <td style="height: 10px">
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Label ID="LblMensaje" runat="server" CssClass="error"></asp:Label>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:UpdatePanel ID="UdPanel2" runat="server">
                    <ContentTemplate>
                        <div id="div-reporte">
                            <p style="text-align: left; text-decoration: underline;">
                                <asp:Label ID="Label7" runat="server" Text="Información" CssClass="label2"></asp:Label><br />
                            </p>
                            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
                                InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
                                Width="980px" Height="500px">
                                <LocalReport ReportPath="Reportes\ReporteSync.rdlc">
                                    <DataSources>
                                        <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
                                    </DataSources>
                                </LocalReport>
                            </rsweb:ReportViewer>
                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
                                SelectMethod="GetData" TypeName="NMT_WEB.ReporteTableAdapters.spReporteSincTableAdapter">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="HiddenUsuario" Name="Usuario" PropertyName="Value"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="HiddenIDsKPIs" Name="KPIs" PropertyName="Value"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="HiddenFechaDe" Name="FechaDe" PropertyName="Value"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="HiddenFechaA" Name="FechaA" PropertyName="Value"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="HiddenIDsZonas" Name="IDsZonas" PropertyName="Value"
                                        Type="String" />
                                    <asp:ControlParameter ControlID="HiddenIDsTerritorios" Name="Territorios" PropertyName="Value"
                                        Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td style="height: 80px">
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
